package com.shanshan.system.config;

import com.shanshan.system.service.CodeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * -*- coding:utf-8 -*-
 *
 * @author 太阳偷渡青山
 * @software IntelliJ IDEA
 * @date 2023/01/19 10:44
 * @Description 交于spring容器帮你创建该类的对象
 */
@Component
public class CodeQuartz {
    @Autowired
    private CodeService codeService;

    //业务代码----规定什么时候执行该业务代码 https://cron.qqe2.com/
//    @Scheduled(cron = "0 0 2 1/1 * ?") // 在每日的凌晨2点调整任务
    @Scheduled(cron = "0 0/2 * * * ?") //测试 每2分钟实现一次
    public void test01(){
        codeService.remove(null);
        System.out.println("更新=========");
    }
}